/*
    1、不考虑效率，单纯实现 6.5min 左右
       当然，事先画简单的流程图，时间不清楚，但，总共也不会超过10min

    2、粗暴简单的初版测试函数+简单测试用例，~5.5min
       一次通过
*/
#include <stdlib.h>
#include <string.h>

void rid_ch(char *A,char ch)
{
    size_t last = -1,next = 0;
    
    if(NULL == A)
        return;

    if('\0' == A[0])
        return;

    do
    {
        if(ch == A[next])
            next++;
        else
        {
            last++;
            A[last] = A[next];
            next++;
        }
    }while('\0' != A[next]);

    last++;
    A[last] = '\0';
}

#include <stdio.h>

void test_rid_ch(char *A,char ch)
{
    size_t pos,i,len;

    printf("rid %c in %s\n",ch,A);

    rid_ch(A,ch);
    printf("%s\n",A);
} 

// end of file ----------------------------------------------------------------
